home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / weelactx / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-25  |  4.7 KB  |  161 lines

  1. VERSION 5.00
  2. Object = "{8E4795DA-35BA-11D1-AEFE-004005126284}#2.0#0"; "Wheels.ocx"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Wheel Demo"
  6.    ClientHeight    =   6270
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   7650
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   6270
  14.    ScaleWidth      =   7650
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.TextBox Text1 
  18.       Height          =   3495
  19.       Left            =   120
  20.       MultiLine       =   -1  'True
  21.       TabIndex        =   9
  22.       Text            =   "Form1.frx":0000
  23.       Top             =   2700
  24.       Width           =   6195
  25.    End
  26.    Begin VB.CommandButton Command1 
  27.       Caption         =   "About ..."
  28.       Height          =   495
  29.       Left            =   6420
  30.       TabIndex        =   8
  31.       Top             =   2700
  32.       Width           =   1035
  33.    End
  34.    Begin Wheels.Wheel Wheel2 
  35.       Height          =   180
  36.       Left            =   1560
  37.       TabIndex        =   7
  38.       Top             =   2280
  39.       Width           =   1650
  40.       _ExtentX        =   2910
  41.       _ExtentY        =   318
  42.       Style           =   1
  43.    End
  44.    Begin Wheels.Wheel Wheel1 
  45.       Height          =   1650
  46.       Index           =   0
  47.       Left            =   120
  48.       TabIndex        =   4
  49.       Top             =   420
  50.       Width           =   180
  51.       _ExtentX        =   318
  52.       _ExtentY        =   2910
  53.    End
  54.    Begin VB.PictureBox Picture1 
  55.       BackColor       =   &H00FFFFFF&
  56.       Height          =   1995
  57.       Left            =   1500
  58.       ScaleHeight     =   1935
  59.       ScaleWidth      =   1695
  60.       TabIndex        =   0
  61.       ToolTipText     =   "test"
  62.       Top             =   120
  63.       Width           =   1755
  64.    End
  65.    Begin Wheels.Wheel Wheel1 
  66.       Height          =   1650
  67.       Index           =   1
  68.       Left            =   600
  69.       TabIndex        =   5
  70.       Top             =   420
  71.       Width           =   180
  72.       _ExtentX        =   318
  73.       _ExtentY        =   2910
  74.    End
  75.    Begin Wheels.Wheel Wheel1 
  76.       Height          =   1650
  77.       Index           =   2
  78.       Left            =   1080
  79.       TabIndex        =   6
  80.       Top             =   420
  81.       Width           =   180
  82.       _ExtentX        =   318
  83.       _ExtentY        =   2910
  84.    End
  85.    Begin VB.Label Label1 
  86.       BorderStyle     =   1  'Fixed Single
  87.       Caption         =   "255"
  88.       Height          =   255
  89.       Index           =   2
  90.       Left            =   1020
  91.       TabIndex        =   3
  92.       Top             =   0
  93.       Width           =   375
  94.    End
  95.    Begin VB.Label Label1 
  96.       BorderStyle     =   1  'Fixed Single
  97.       Caption         =   "255"
  98.       Height          =   255
  99.       Index           =   1
  100.       Left            =   540
  101.       TabIndex        =   2
  102.       Top             =   0
  103.       Width           =   375
  104.    End
  105.    Begin VB.Label Label1 
  106.       BorderStyle     =   1  'Fixed Single
  107.       Caption         =   "255"
  108.       Height          =   255
  109.       Index           =   0
  110.       Left            =   60
  111.       TabIndex        =   1
  112.       Top             =   0
  113.       Width           =   375
  114.    End
  115. Attribute VB_Name = "Form1"
  116. Attribute VB_GlobalNameSpace = False
  117. Attribute VB_Creatable = False
  118. Attribute VB_PredeclaredId = True
  119. Attribute VB_Exposed = False
  120. Option Explicit
  121. Dim arrRGB(3) As Byte
  122. Private Sub Command1_Click()
  123.     Wheel2.About
  124. End Sub
  125. Private Sub Form_Load()
  126.     arrRGB(0) = 255
  127.     arrRGB(1) = 255
  128.     arrRGB(2) = 255
  129. End Sub
  130. Private Sub Wheel1_Wheel(Index As Integer, Direction As Wheels.Direction)
  131.     Select Case Direction
  132.         Case wheelUp, wheelRight
  133.             If arrRGB(Index) < 255 Then
  134.                 arrRGB(Index) = arrRGB(Index) + 1
  135.             End If
  136.             
  137.         Case wheelDown, wheelLeft
  138.             If arrRGB(Index) > 0 Then
  139.                 arrRGB(Index) = arrRGB(Index) - 1
  140.             End If
  141.             
  142.     End Select
  143.     Picture1.BackColor = RGB(arrRGB(0), arrRGB(1), arrRGB(2))
  144.     Label1(Index) = arrRGB(Index)
  145. End Sub
  146. Private Sub Wheel2_Wheel(Direction As Wheels.Direction)
  147. Const MIN_WIDTH = 300
  148. Const MIN_BORDER = 100
  149.     With Picture1
  150.         If Direction = wheelRight Then
  151.             If .Left + .Width < ScaleWidth - MIN_BORDER Then
  152.                 .Width = .Width + 50
  153.             End If
  154.         Else
  155.             If .Width > MIN_WIDTH Then
  156.                 .Width = .Width - 50
  157.             End If
  158.         End If
  159.     End With
  160. End Sub
  161.